<?php  
    session_start();  
    if(isset($_SESSION['error'])){  
        $error = $_SESSION['error'];  
        $_POST = $_SESSION['post'];  
        unset($_SESSION['error']);  
        unset($_SESSION['post']);  
    }  
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Brops Dox Registration</title>
        <link href="styles/styles.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="css/register.css"/>
    </head>

    <body>
        <div id="mainWrap">
            <div id="mainPanel">
                <div id="menu">
                    <ul>
                        <li><a href="index.php"><span>Home</span></a></li>
                        <li><div class="blank"></div></li>
                        <li><a href="register.php"><span>Register</span></a></li>
                        <li><div class="blank"></div></li>
                        <li><a href="#"><span>About Us</span></a></li>
                    </ul>
                </div>
                <div id="loginPanel">
                    <h2>Registration</h2>
                    <form enctype="multipart/form-data" action="validation.php" method="post">
                    </br></br></br>Username : </br>
                    <input name="username" id="username" type="text" value="<?php echo isset($_POST['username']) ? $_POST['username'] : '';?>"/>
                    <div id="usernameerror" style="color:red"><?php echo isset($error['username']) ? $error['username'] : '';?></div>
                    <div class="blank"></div></br></br>
                    Password : </br>
                    <input name="pwd1" id="pwd1" type="password" value="<?php echo isset($_POST['pwd1']) ? $_POST['pwd1'] : '';?>"/>
                    <div class="blank"></div></br></br>
                    Confirm Password : </br>
                    <input name="pwd2" id="pwd2" type="password" value="<?php echo isset($_POST['pwd2']) ? $_POST['pwd2'] : '';?>"/>
                    <div id="pwderror" style="color:red"><?php echo isset($error['pwd']) ? $error['pwd'] : '';?></div>
                    <div class="blank"></div></br></br>
                    Email : </br>
                    <input name="email" id="email" type="text" value="<?php echo isset($_POST['email']) ? $_POST['email'] : '';?>"/>
                    <div id="emailerror" style="color:red"><?php echo isset($error['email']) ? $error['email'] : '';?></div>
                    </br></br>
                    <input class="login" type="submit" name="select" value="Register" />
                    </form>
                </div>
            </div>
    </body>
</html>
